Introduction to 8085

Intel introduced the Intel 8085, an 8-bit microprocessor, in 1977. Because it needed less auxiliary hardware and was binary compatible with the more well-known Intel 8080, simpler and less expensive microcomputer systems could be constructed.


The model number "5" was derived from the fact that the 8085 only needed a +5-Volt (V) power supply, as opposed to the +5 V, −5 V, and +12 V supplies that the 8080 required.

🔑Key Characteristics

  • It's a microprocessor with eight bits.
  • It is produced utilizing N-MOS technology.
  • Because of its 16-bit address bus, it can access memory locations through A0–A15, or 216 = 65536 bytes (64KB).
  • AD0–AD7 is the multiplex of the first eight address bus lines and the first eight data bus lines.
  • Data bus consists of 8 lines, D0 through D7.
  • External interrupt requests are supported.
  • A 16-bit stack pointer (SP) with a 16-bit program counter (PC)
  • Six general purpose registers with eight bits each, paired off as BC, DE, and HL.
  • It runs at 3.2 MHZ single phase clock and needs a signal +5V power supply.
  • It has 40 DIP (Dual in line package) pins enclosed.

8085 Architecture

As seen in Fig. 1, 8085 is made up of several units, each of which carries out a specific duty. The following is a list of a microprocessor's different units:

Program Counter
Stack Pointer
Timing and Control Unit
Interrupt Control
Temporary Register
Accumulator
Arithmetic and Logic Unit
General Purpose Registers
Address Buffer
Address-Data Buffer
Flags
Instruction Register & Decoder

Key Components

📦Accumulator

A register that can store 8-bit data is all an Accumulator is. Accumulator makes it easier to store two quantities simultaneously. An accumulator stores the data that will be processed by an arithmetic and logic unit. The outcome of the operation performed by the Arithmetic and Logic unit is likewise stored there. An 8-bit register is another name for the accumulator. The ALU (arithmetic and logic unit) and Internal Data Bus are connected to the accumulator. The Internal Data Bus can be utilized to transmit and receive data through the accumulator.

🧮Arithmetic and Logic Unit

Arithmetic operations such as +, -, *, and /, as well as logical operations such as AND, OR, NOT, and so forth, are always required. Thus, the creation of a distinct unit capable of carrying out these kinds of tasks is required. The Arithmetic and Logic Unit (ALU) handles these functions. These procedures are carried out via ALU on 8-bit data. However, without an input (or) set of data on which to perform the intended operation, these operations cannot be carried out. Where do these inputs come from then to get to the ALU? An accumulator is utilized in this situation. The accumulator and temporary register provide the input for the ALU. Once the required processes have been completed, the outcome is returned to the accumulator.

🗃️General Purpose Registers

Six unique register types known as General Purpose Registers make up 8085, aside from the accumulator. As with other registers, data is stored in these general-purpose registers. The 8085 processors have the following general-purpose registers: B, C, D, E, H, and L. A register can store up to 8 bits of data. These registers can be used in pairs to store 16-bit data in addition to the previously mentioned function. To hold 16-bit data, they can function in pairs like B-C, D-E, and H-L. As a memory pointer, the H-L pair is functional. An individual memory location's address is stored in a memory pointer. In their pairwork, they are able to store 16-bit addresses.

📍Program Counter and Stack Pointer

Program counter is a special purpose register. Consider that an instruction is being executed by processor. As soon as the ALU finished executing the instruction, the processor looks for the next instruction to be executed. So, there is a necessity for holding the address of the next instruction to be executed in order to save time. This is taken care by the program counter. A program counter stores the address of the next instruction to be executed. In other words, the program counter keeps track of the memory address of the instructions that are being executed by the microprocessor and the memory address of the next instruction that is going to be executed. Microprocessor increments the program whenever an instruction is being executed, so that the program counter points to the memory address of the next instruction that is going to be executed. Program counter is a 16-bit register.


Stack pointer is also a 16-bit register which is used as a memory pointer. A stack is nothing but the portion of RAM (Random access memory). So, does that mean the stack pointer points to portion of RAM? Yes. The address of the most recent byte added to the stack is kept track of by the stack pointer. The stack pointer is decreased each time data is added to the stack. On the other hand, when data is taken out of the stack, it is increased.

🔄Temporary Register

During arithmetic and logical processes, this register serves as a temporary memory, as its name implies. This temporary register is totally inaccessible to programmers and is solely accessible by the microprocessor, in contrast to other registers. An 8-bit register is a temporary register.

Flags

All that Flags are is a collection of single Flip-flops. The flags are mostly connected to operations in logic and arithmetic. Depending on the data conditions in the accumulator and other registers, the flags will display a logical (0 or 1), or a set or reset. In reality, a flag is just a latch that can store data. It notifies the processor that an event has occurred.

S
Z
AC
P
CY

🚩Types of Flags

Intel processors have a set of 5 flags:

🔄

Carry flag

Set when there is a carry out of the most significant bit (MSB) after an arithmetic operation.

🔢

Parity flag

Set if the result has even parity (even number of 1 bits), reset for odd parity.

Auxiliary carry flag

Set when there is a carry from the 3rd bit to 4th bit after an arithmetic operation.

0️⃣

Zero flag

Set if the result of an operation is zero, reset otherwise.

+/-

Sign flag

Set if the result is negative (MSB is 1), reset if positive (MSB is 0).

🧮Flag Examples

Carry Flag Example:

Consider two binary numbers:

1100 0000
1000 0000

The most significant bit generates a carry when the two values above are added. The most significant bit is the number on the extreme left, and the least significant bit is the number on the extreme right. Thus, the carry results in the generation of a ninth bit. Then, how can the ninth bit be used in an eight-bit register? This is the use of the Carry flag. Every time a carry is generated, the carry flag is set; it is reset when there isn't a carry.


Auxiliary Carry Flag Example:

Take a look at the two numbers below:

0000 1100
0000 1001

The fourth bit from the least significant bit generates a carry when we add the two values. Auxiliary carry flag is set as a result. The secondary carry flag is reset in the event that there is no carry. The carry flag is thus set whenever there is a carry in the most important bit. Conversely, a carry that is created in bits other than the most significant bit only results in the setting of an auxiliary carry flag.

Instruction Register and Decoder

Like all other microprocessor registers, the instruction register is an 8-bit register. Think of a directive. The instructions could be anything from copying a data to moving a data or adding two data, among other things. An instruction of this type is sent to the instruction register when it is retrieved from memory. Thus, the purpose of the instruction registers is to hold the instructions that are retrieved from memory. The data contained in the instruction register is decoded by an instruction decoder so that it can be processed further.

📥
Instruction Fetch

Retrieved from memory

📋
Instruction Register

Holds the instruction

🔍
Instruction Decoder

Decodes for execution

Timing and Control Unit

Because it synchronizes the registers and data flow through many registers and other units, the timing and control unit is a crucial component of the system. This unit transmits control signals required for both internal and external control of data and other units. It is composed of an oscillator and a controller sequencer. The oscillator produces two-phase clock impulses that help the 8085 microprocessor's registers all synchronize.

🎛️Control Signals

RD

RD' (Read)

Active low signal to indicate reading data from memory or I/O device.

WR

WR' (Write)

Active low signal to indicate writing data to memory or I/O device.

ALE

ALE (Address Latch Enable)

Control signal to synchronize the microprocessor's components and timing for instructions.

📊Status Signals

S0

Status Signal 0

Used with S1 and IO/M' to indicate the type of operation.

S1

Status Signal 1

Used with S0 and IO/M' to indicate the type of operation.

IO/M

IO/M' (Input/Output/Memory)

Used to indicate whether the operation belongs to the memory or peripherals.

🔄DMA Signals

HOLD

HOLD

Denotes a request for address and data bus usage from another master. The CPU will give up bus usage as soon as the current bus transfer is finished after receiving the hold request.

HLDA

HLDA (Hold Acknowledge)

Indicates that the CPU has received the HOLD request and will release the bus in the subsequent clock cycle.

READY

READY

This signal brings the slow peripherals and fast CPU into sync. The memory or peripheral is prepared to send or receive data if READY is high during a read or write cycle.

🔄Reset Signals

RESET IN

RESET IN

When this pin is low:

  • Zeroes out the program counter (0000H)
  • Resets the HLDA flip-flops and interrupt enables
  • The data bus, address bus, and control bus are tri-stated
  • Randomly modifies the contents of the internal registers of the CPU

RESET OUT

RESET OUT

The processor is being reset, as indicated by this active high signal. This signal can be used to reset other system-connected devices and is synced with the processor clock.

Interrupt Control

This control stops a process, as its name implies. The main program is being run by a microprocessor, consider. Currently, the microprocessor switches over to handle incoming requests when the interrupt signal is activated or requested. Once the request is processed, the microprocessor returns control to the main program. To indicate that the data is prepared for entry, an input/output device can, for instance, emit an interrupt signal.


The microprocessor gives the I/O device control while momentarily stopping the main program's execution. The control is returned to the main program once the input data has been collected. The following interrupt signals are found in 8085: INTR, RST 7.5, RST 6.5, and RST 5.5.

Types of Interrupts

INTR

INTR

Maskable 8080A compatible interrupt. When an interrupt happens, the CPU retrieves one instruction from the bus:

  • One of the eight RST commands (RST0–RST7)
  • Call instruction (3-byte instruction)

RST 5.5

RST 5.5

Maskable interrupt. Upon receiving this interruption, the Hexadecimal address 2CH is where the processor branches after saving the contents of the PC register into a stack.

RST 6.5

RST 6.5

Maskable interrupt. Upon receiving this interrupt, the CPU branches to the 34H (hexadecimal) address and stores the contents of the PC register in the stack.

RST 7.5

RST 7.5

Maskable interrupt. Upon receiving this interrupt, the CPU branches to the 3CH (hexadecimal) address and stores the contents of the PC register in the stack.

TRAP

TRAP

Non-maskable interrupt. Upon receiving this interrupt, the CPU branches to the 24H (hexadecimal) address and stores the contents of the PC register in the stack.

🔧Interrupt Control

With the use of EI and DI commands, all maskable interrupts can be activated or disabled. SIM instructions can be used to independently enable or disable RST5.5, RST6.5, and RST7.5 interrupts.

Serial Input/Output Control

The input and output of serial data can be carried out using 2 instructions in 8085.

SID

SID (Serial Input Data)

Used for serial data input

SOD

SOD (Serial Output Data)

Used for serial data output

🔄Serial-Parallel Conversion

Two more instructions are used to perform serial-parallel conversion needed for serial I/O devices.

SIM

SIM (Set Interrupt Mask)

Used to set the interrupt mask and to output data through SOD line

RIM

RIM (Read Interrupt Mask)

Used to read the interrupt mask and to input data through SID line

Address Buffer, Address-Data Buffer, and Bus System

📡Address Buffer and Address-Data Buffer

The address buffer and address-data buffer are filled with the contents of the program counter and stack pointer. The address-data bus and external address bus are then driven by these buffers. The CPU may exchange desired data with the memory and I/O chips since they are connected to these busses.


The internal data bus, which has eight bits, and the external data bus are both connected to the address-data buffer. Data from the internal data bus can be sent and received via the address data buffer.

🚌Data Bus and the Address Bus

It is known that the 8085 microprocessor has eight bits. Consequently, the microprocessor's data bus has an 8-bit width. Thus, eight bits of data can be sent. Either to or from the CPU. However, because memory addresses are 16 bits wide, the 8085 CPU needs a 16-bit address bus. The eight most important components of the address bus is used to communicate addresses, while the multiplexed address/data bus is used to transmit the eight least significant bits. The eight least significant bits of the address bus are multiplexed with the eight-bit data bus.

⏱️Time Multiplexing

The data bus and address bus are time multiplexed. This indicates that the data is created by the same pin for a few seconds after the eight least significant bits of the address are generated for a few microseconds. We refer to this as time multiplexing.


However, there are instances in which it's necessary to send data and an address at the same time. The signal known as ALE (address latch enables) is utilized for this purpose. The address is also available at the output latch when the CPU sends the data again because the ALE signal retains the received address in its latch until the data is obtained. We refer to this method as Address/Data demultiplexing.

🔄
Time Multiplexing

Same pins used for address and data at different times

🔒
ALE Signal

Latches address while data is being transmitted

📡
Demultiplexing

Separates address and data signals